package com.example.design_pattern.mediator;

/**
 * 具体调停者
 */
public class ConcretMediator extends Mediator {

    private Colleague mColleague1;

    private Colleague mColleague2;


    /**
     * 当某个同事对象发生变化时，会调用该方法
     * 在该方法中通知所有同事
     */
    @Override
    public void colleagueChanged(Colleague colleague) {
        mColleague1.action();
        mColleague2.action();
    }


    public void setmColleague1(Colleague mColleague1) {
        this.mColleague1 = mColleague1;
    }

    public void setmColleague2(Colleague mColleague2) {
        this.mColleague2 = mColleague2;
    }
}
